Skip to content

feat(google-translate): add Google Translate integration#3337

Merged
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/add-google-translate
Feb 25, 2026
Merged

feat(google-translate): add Google Translate integration#3337
waleedlatif1 merged 2 commits intostagingfrom
waleedlatif1/add-google-translate

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Add Google Translate integration with translate text and detect language operations
  • Uses Google Cloud Translation API v2 with API key auth
  • Includes auto-generated docs

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 25, 2026 9:12pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 25, 2026

Greptile Summary

This PR adds a Google Translate integration with two operations: translate text and detect language. The implementation uses Google Cloud Translation API v2 with API key authentication passed as a query parameter (the correct method for this API).

  • Implements google_translate_text tool for translating text between languages with optional source language auto-detection
  • Implements google_translate_detect tool for detecting the language of input text
  • Adds comprehensive block configuration with 33 target language options and 17 source language options
  • Includes complete documentation with input/output parameter tables
  • Follows project patterns for tool configuration, API key visibility (user-only), and error handling
  • Properly registers tools and blocks in alphabetical order in registries
  • Adds Google Translate icon SVG to both app and docs

The documentation already addresses the missing input parameters issue mentioned in previous threads.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Clean implementation following established patterns, proper TypeScript types, correct API key visibility, appropriate error handling, and comprehensive documentation
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/google_translate/text.ts Implements translate text tool with proper API key handling and error handling
apps/sim/tools/google_translate/detect.ts Implements language detection tool with proper API integration
apps/sim/blocks/blocks/google_translate.ts Block configuration with comprehensive language options and proper operation switching
apps/docs/content/docs/en/tools/google_translate.mdx Complete documentation with input/output tables for both tools

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User Input] --> B{Operation Type}
    B -->|text| C[google_translate_text]
    B -->|detect| D[google_translate_detect]
    
    C --> E[Build Request]
    D --> F[Build Request]
    
    E --> G{Source Language?}
    G -->|Specified| H[Include source in body]
    G -->|Auto-detect| I[Omit source from body]
    
    H --> J[Add apiKey to URL query]
    I --> J
    F --> J
    
    J --> K[POST to Google Translation API v2]
    K --> L{Response}
    
    L -->|Success| M[Transform Response]
    L -->|Error| N[Return Error]
    
    M --> O{Operation}
    O -->|text| P[Return translatedText + detectedSourceLanguage]
    O -->|detect| Q[Return language + confidence]
Loading

Last reviewed commit: f383aa5

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 063ec87 into staging Feb 25, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/add-google-translate branch February 25, 2026 21:24
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

{ label: 'Turkish', id: 'tr' },
{ label: 'Dutch', id: 'nl' },
{ label: 'Polish', id: 'pl' },
],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source language dropdown missing 18 languages from target

Medium Severity

The source language dropdown only has 16 language options (English through Polish), while the target language dropdown has 34 options. This appears to be an accidental truncation — 18 languages (Swedish, Thai, Vietnamese, Indonesian, Ukrainian, Czech, Greek, Hebrew, Romanian, Hungarian, Danish, Finnish, Norwegian, Bengali, Malay, Filipino, Swahili, Urdu) are available as targets but not as explicit source languages. Users translating from these languages can't specify them and must rely on auto-detect.

Additional Locations (1)

Fix in Cursor Fix in Web

url: (params) => {
const url = new URL('https://translation.googleapis.com/language/translate/v2')
url.searchParams.set('key', params.apiKey)
return url.toString()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .trim() on API key, unlike other Google tools

Low Severity

The params.apiKey value is used without .trim() when constructing the API URL. Every other Google API tool in the codebase (Google Maps, Google Books, etc.) consistently calls params.apiKey.trim() before setting the key in the URL. This inconsistency means whitespace in the API key input could cause authentication failures only for Google Translate.

Additional Locations (1)

Fix in Cursor Fix in Web

waleedlatif1 added a commit that referenced this pull request Feb 25, 2026
* feat(google-translate): add Google Translate integration

* fix(google-translate): api key as query param, fix docsLink, rename tool file
waleedlatif1 added a commit that referenced this pull request Feb 25, 2026
* feat(workflow): lock/unlock workflow from context menu and panel

* lint

* fix(workflow): prevent duplicate lock notifications, no-op guard, fix orphaned JSDoc

* improvement(workflow): memoize hasLockedBlocks to avoid inline recomputation

* feat(google-translate): add Google Translate integration (#3337)

* feat(google-translate): add Google Translate integration

* fix(google-translate): api key as query param, fix docsLink, rename tool file

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar (#3338)

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar

* fix(google-drive): remove dead transformResponse from move tool

* feat(confluence): return page content in get page version tool (#3344)

* feat(confluence): return page content in get page version tool

* lint

* feat(api): audit log read endpoints for admin and enterprise (#3343)

* feat(api): audit log read endpoints for admin and enterprise

* fix(api): address PR review — boolean coercion, cursor validation, detail scope

* ran lint

* unified list of languages for google translate

* fix(workflow): respect snapshot view for panel lock toggle, remove unused disableAdmin prop

* improvement(canvas-menu): remove lock icon from workflow lock toggle

* feat(audit): record audit log for workflow lock/unlock
waleedlatif1 added a commit that referenced this pull request Feb 26, 2026
* feat(workflow): lock/unlock workflow from context menu and panel

* lint

* fix(workflow): prevent duplicate lock notifications, no-op guard, fix orphaned JSDoc

* improvement(workflow): memoize hasLockedBlocks to avoid inline recomputation

* feat(google-translate): add Google Translate integration (#3337)

* feat(google-translate): add Google Translate integration

* fix(google-translate): api key as query param, fix docsLink, rename tool file

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar (#3338)

* feat(google): add missing tools for Gmail, Drive, Sheets, and Calendar

* fix(google-drive): remove dead transformResponse from move tool

* feat(confluence): return page content in get page version tool (#3344)

* feat(confluence): return page content in get page version tool

* lint

* feat(api): audit log read endpoints for admin and enterprise (#3343)

* feat(api): audit log read endpoints for admin and enterprise

* fix(api): address PR review — boolean coercion, cursor validation, detail scope

* ran lint

* unified list of languages for google translate

* fix(workflow): respect snapshot view for panel lock toggle, remove unused disableAdmin prop

* improvement(canvas-menu): remove lock icon from workflow lock toggle

* feat(audit): record audit log for workflow lock/unlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant